package com.lijin.batchsys.framework.enums;

public enum BatchRunType {

	ONE_TIME_DAILY("1", "每日执行一次"),
	MULTI_TIMES_DAILY("2", "每日指定时间执行多次"),
	CYCLING("3", "按照指定时间循环执行"),
	HAND_HOLD("4", "手工任务（用于定时任务失败时人工处理使用）");
	
	private String code;
	private String desc;
	
	private BatchRunType(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static BatchRunType parseByCode(String code) {
		for (BatchRunType brt : BatchRunType.values()) {
			if (brt.getCode().equals(code)) {
				return brt;
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
}
